Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

load-module

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

load-module

Node's `require` with a few extra features

  • 2.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
128K
decreased by-5.06%
Maintainers
1
Weekly downloads
 
Created
Source

view on npm npm module downloads Build Status Coverage Status Dependency Status js-standard-style

load-module

Node's require with a few extra features:

  • You can specify additional folders in which to search for modules
  • You can specify a module prefix

Example

> const loadModule = require('load-module')

> loadModule('react-dom')

> loadModule('dom', { prefix: 'react-' })

> loadModule('something.js', { paths: '.' })

> loadModule('something.js', { paths: [ '.', '~/my-modules' ] })

loadModule(request, [options]) ⏏

Kind: Exported function

ParamTypeDescription
requeststringThe module name, directory or file to load.
[options]object
[options.paths]string | Array.<string>One or more additional directories in which to search for modules. For each path specified, both the path itself and ${path}/node_modules will be searched.
[options.prefix]stringAttempt to load the given module name with this prefix. Only useful where request is a module name.

© 2017-19 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.

Keywords

FAQs

Package last updated on 30 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc